package com.peng.egmvc1.mapper;

import com.peng.egmvc1.pojo.entity.Address;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author peng
 * @Date 2024-04-22 19:14
 */
public interface AddressMapper {

    @Insert("insert into address(id, receiver, address, email, mobile, tag)\n" +
            "values(#{id}, #{receiver}, #{address}, #{email}, #{mobile}, #{tag})")
    int insertAddress(Address address);

    @Select("select id, receiver, address, email, mobile, tag from address")
    List<Address> selectAllAddress();

    @Delete("delete from address where id = #{id}")
    int deleteAddressById(Integer id);

    int updateAddress(Address address);
}
